.\" libxbee - a C library to aid the use of Digi's XBee wireless modules
.\"           running in API mode.
.\" 
.\" Copyright (C) 2009 onwards  Attie Grande (attie@attie.co.uk)
.\" 
.\" libxbee is free software: you can redistribute it and/or modify it
.\" under the terms of the GNU Lesser General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\" 
.\" libxbee is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU Lesser General Public License for more details.
.\" 
.\" You should have received a copy of the GNU Lesser General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.TH XBEE_LOGLEVELGET 3  04-Mar-2012 "GNU" "Linux Programmer's Manual"
.SH NAME
xbee_logLevelGet, xbee_logLevelSet, xbee_logTargetGet, xbee_logTargetSet
.SH SYNOPSIS
.B #include <xbee.h>
.sp
.BI "xbee_err xbee_logLevelGet(struct xbee *" xbee ", int *" level ");"
.sp
.BI "xbee_err xbee_logLevelSet(struct xbee *" xbee ", int " level ");"
.sp
.BI "xbee_err xbee_logTargetGet(struct xbee *" xbee ", FILE **" f ");"
.sp
.BI "xbee_err xbee_logTargetSet(struct xbee *" xbee ", FILE *" f ");"
.SH DESCRIPTION
These functions allow you to configure and retrieve the logging options for an instance of libxbee.
.sp
The
.I level
may be any number, and indicates the verbosity of log messages.
A higher number will generate a more verbose output. See
.BR xbee_log (3)
for more details on how this affects log output.
.sp
You may redirect the log output using
.BR xbee_logTargetSet ().
.I f
must be an open file descriptor that will allow writing.
.sp
By default, libxbee will log to stderr.
.SS Return Value
On success these functions will return XBEE_ENONE, otherwise an error number from
.IR "enum xbee_errors" " (as specified in " <xbee.h> )
.SH EXAMPLE
.in +4n
.nf
#include <xbee.h>

struct xbee *xbee;
FILE *log;

/* initialize xbee, using xbee_setup() */

if ((log = fopen("libxbee.log", "w")) == NULL) return;

if (xbee_logTargetSet(xbee, log) != XBEE_ENONE) return;

if (xbee_logLevelSet(xbee, 100) != XBEE_ENONE) return;
.fi
.in
.SH AUTHOR
Attie Grande <attie@attie.co.uk> 
.SH "SEE ALSO"
.BR libxbee (3),
.BR xbee_setup (3),
.BR xbee_log (3)
